package com.tangbao.vuedata.service.impl;

import com.tangbao.vuedata.mapper.OneNewsMapper;
import com.tangbao.vuedata.model.OneNews;
import com.tangbao.vuedata.service.OneNewsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 功能:
 * 作者: zhouxin
 * 日期: 2018/3/2
 */
@Service(value = "oneNewsServiceImpl")
public class OneNewsServiceImpl implements OneNewsService {
    @Resource
    OneNewsMapper oneNewsMapper;

    /**
     * 分页查询全部一级菜单
     * @param start
     * @param pageSize
     * @return
     */
    @Override
    public List<OneNews> getOneNewsByAll(Integer start, Integer pageSize) {
        List<OneNews> allOneNewss = oneNewsMapper.getOneNewsByAll(start,pageSize);
        return allOneNewss;
    }

    @Override
    public List<Object> getlunbolist(Integer start, Integer pageSize) {
        List<Object> allOneNewss = oneNewsMapper.getlunbolist(start,pageSize);
        return allOneNewss;
    }

    @Override
    public OneNews getOneNewsByAll(Integer id) {
        OneNews oneNewss = oneNewsMapper.getOneNewsById(id);
        return oneNewss;
    }

    public int saveOneNews(OneNews oneNews) {
        int size = oneNewsMapper.saveOneNews(oneNews);
        return size;
    }

    public int updateOneNews(OneNews oneNews) {
        int size = oneNewsMapper.updateOneNews(oneNews);
        return size;
    }

}
